﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2008A.ShoppingCode.Domain
{
    /// <summary>
    /// spu表
    /// </summary>
    [Table("tb_new_product_spu")]
    public class NewProductSPUEntity
    {
        /// <summary>
        /// SPU主键
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 产品编码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 品牌ID
        /// </summary>
        public Guid? BrandId { get; set; }

        /// <summary>
        /// 分类Id
        /// </summary>
        public Guid? CategoryId { get; set; }

        /// <summary>
        /// 主图
        /// </summary>
        public string? MasterImage { get; set; }

        /// <summary>
        /// 产品描述
        /// </summary>
        public string? Description { get; set; }
        /// <summary>
        /// 包装信息
        /// </summary>
        public string? PackInfo { get; set; }

        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime? CreatedTime { get; set; } = System.DateTime.UtcNow;

        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreatedBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        public string? UpdateBy { get; set; }
    }

    /// <summary>
    /// sku表
    /// </summary>
    [Table("tb_new_product_sku")]
    public class NewProductSKUEntity
    {
        /// <summary>
        /// 商品SKU主键
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 商品编码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// SPUId
        /// </summary>
        public Guid? Spuid { get; set; }

        /// <summary>
        /// 颜色id
        /// </summary>
        public Guid? ColorId { get; set; }

        /// <summary>
        /// 尺寸Id 
        /// </summary>
        public Guid? SizeId { get; set; }

        /// <summary>
        /// 采购价格
        /// </summary>
        public decimal? PurchasePrice { get; set; }

        /// <summary>
        /// 市场价格
        /// </summary>
        public decimal? MarketPrice { get; set; }

        /// <summary>
        /// 销售价格
        /// </summary>
        public decimal? SalePrice { get; set; }

        /// <summary>
        /// 销售数量
        /// </summary>
        public int? SaleNumber { get; set; }

        /// <summary>
        /// 原始库存
        /// </summary>
        public int? Stock { get; set; }

        /// <summary>
        /// 有效库存（可用）
        /// </summary>
        public int? ValidStock { get; set; }

        /// <summary>
        /// 锁定库存
        /// </summary>
        public int? LockStock { get; set; }

        /// <summary>
        /// 最少库存
        /// </summary>
        public int? MinStock { get; set; }

        /// <summary>
        /// 是否上架
        /// </summary>
        public string? IsUp { get; set; } = "0"; //0是上架，1下架

        /// <summary>
        /// 标识
        /// </summary>
        public string? Flag { get; set; } = "00000000";

        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime? CreatedTime { get; set; } = System.DateTime.UtcNow;

        public string? CreatedBy { get; set; }

        public DateTime? UpdateTime { get; set; }

        public string? UpdateBy { get; set; }
    }

    /// <summary>
    /// sku对应的图片表
    /// </summary>
    [Table("tb_new_product_sku_image")]
    public class NewProductSKUImageEntity
    {
        public Guid Id { get; set; }
        public Guid SKUId { get; set; } //关联的SKUId 
        public string? ImagePath { get; set; } //图片路径
    }

    /// <summary>
    /// sku对应的评论表
    /// </summary>
    [Table("tb_new_product_sku_comment")]
    public class NewProductSKUCommentEntity
    {
        public Guid Id { get; set; }
        public Guid SKUId { get; set; } // 评论了谁 -----关联的SKUId 
        public Guid? MemberId { get; set; } //谁 -----会员ID
        public DateTime? CreatedTime { get; set; } = System.DateTime.UtcNow; //什么时候评论的 ---- 当前时间
        public string? Context { get; set; } //评论的内容 
        public string? Statue { get; set; } = "1";//评论需要审核
        public int Point { get; set; } //分数
    }

    /// <summary>
    /// 规格表
    /// </summary>
    [Table("tb_new_product_spec")]
    public class NewProductSpecEntity
    {
        public Guid Id { get; set; }
        public Guid? CategoryId { get; set; } //分类。此次netproduct中不用
        public string SpecType { get; set; } //规格类型 color,size,....
        public string SpecValue { get; set; }//规格值
    }
}
